package com.foreknow.demo1;

public class TestMethod {
    public void m1(Person person){
        person.eat("fender");
    }
    public Person m2(){
        Person person = new PersonImpl();
        return person;
    }
    public void m3(A a){
        a.m1();
    }
    public A m4(){
        return new AImpl();
    }
    public static void main(String[] args) {
        TestMethod method = new TestMethod();
        Person p = new PersonImpl();
        method.m1(p);
        System.out.println("m3------");
        A a = new AImpl();
        method.m3(a);
        System.out.println("m4------");
        A aa  = method.m4();
        System.out.println(aa.m1());
    }
}
